package com.example.shuiyin.dto;

import lombok.Builder;
import lombok.Data;
import java.time.LocalDateTime;

@Data
@Builder
public class UserQuotaInfo {
    private Integer userLevel;
    private Long maxStorageSize;
    private Long usedStorageSize;
    private Integer maxProcessingCount;
    private Integer usedProcessingCount;
    private LocalDateTime resetDate;
    private LocalDateTime lastUsedTime;
    
    // 计算剩余存储空间
    public Long getRemainingStorageSize() {
        return maxStorageSize - usedStorageSize;
    }
    
    // 计算剩余处理次数
    public Integer getRemainingProcessingCount() {
        return maxProcessingCount - usedProcessingCount;
    }
    
    // 计算存储空间使用百分比
    public Double getStorageUsagePercentage() {
        if (maxStorageSize == 0) {
            return 100.0;
        }
        return (usedStorageSize * 100.0) / maxStorageSize;
    }
} 